﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="frmSeachForumThreads.aspx.cs" Inherits="WCrawler.frmSeachForumThreads" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div>
    <h2>
        <asp:HyperLink ID="hyperLinkForumUrl" runat="server">HyperLink</asp:HyperLink>
    </h2>
</div>
<div>
    <asp:GridView ID="gridViewSeachForumThread" runat="server" AutoGenerateColumns="false" >
        <Columns>
            <asp:TemplateField HeaderText = "Id" SortExpression="Id">
                <ItemTemplate>
                    <asp:Label ID="Id" runat="server" Text='<%#Eval("Id") %>'> </asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText = "Topic">
                <ItemTemplate>
                    <%#Eval("Topic") %>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Replies" HeaderText="Replies" 
                SortExpression="Replies" />
            <asp:BoundField DataField="Views" HeaderText="Views" SortExpression="Views" />
            <asp:TemplateField HeaderText = "Topic">
                <ItemTemplate>
                    <%#Eval("Forum") %>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
</div>
<div>
    <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" 
        Text="Search" />
</div>
<div>
    <asp:GridView ID="gridViewPostForumDetails" runat="server" AutoGenerateColumns="False" 
        DataKeyNames="ForumId,PostDetailsId" 
        DataSourceID="ForumThreadDetailsLinqDataSource">
        <Columns>
            <asp:BoundField DataField="ForumId" HeaderText="ForumId" ReadOnly="True" 
                SortExpression="ForumId" />
            <asp:BoundField DataField="PostDetailsId" HeaderText="PostDetailsId" 
                ReadOnly="True" SortExpression="PostDetailsId" />
            <asp:BoundField DataField="ThreadNum" HeaderText="ThreadNum" 
                SortExpression="ThreadNum" />
            <asp:BoundField DataField="PostUrl" HeaderText="PostUrl" 
                SortExpression="PostUrl" />
            <asp:BoundField DataField="GuestReplies" HeaderText="GuestReplies" 
                SortExpression="GuestReplies" />
            <asp:BoundField DataField="Replies" HeaderText="Replies" 
                SortExpression="Replies" />
            <asp:BoundField DataField="Views" HeaderText="Views" SortExpression="Views" />
            <asp:BoundField DataField="CreateOn" HeaderText="CreateOn" 
                SortExpression="CreateOn" />
            <asp:BoundField DataField="UpdateOn" HeaderText="UpdateOn" 
                SortExpression="UpdateOn" />
        </Columns>
    </asp:GridView>
</div>
    
    <asp:LinqDataSource ID="ForumThreadDetailsLinqDataSource" runat="server" 
        ContextTypeName="WCrawlerLib.LinqDataClassesDataContext" EntityTypeName="" 
        TableName="PostForumDetails" Where="ForumId == @ForumId">
        <WhereParameters>
            <asp:QueryStringParameter Name="ForumId" QueryStringField="ForumId" 
                Type="Int32" />
        </WhereParameters>
    </asp:LinqDataSource>
</asp:Content>
